﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>2.高级视图语法—循环</title>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shCore.js"></script>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shBrushCSharp.js"></script>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shBrushXml.js"></script>
    <link type="text/css" rel="stylesheet" href="../../Content/highlighter/styles/shCoreDefault.css" />
    <script type="text/javascript">SyntaxHighlighter.all();</script>
</head>
<body>
	<h3>高级视图语法—循环</h3>
    <pre class="brush: csharp;">
        //Foreach循环
        @foreach(var c in b)
        { 
            @c.Current.ToString()
        }

        //For循环
        @for(int  i = 0;i &lt; b.Length;i++)
        {
            @b[i].ToString()
        }

        //While do循环
        @{int k = 0;}
        @while(k &lt; b.Length;)
        {
            @b[k].ToString()
            @k++
        }
	</pre>
</body>
</html>
